package com.clementheliou.cheliou.business.dataaccess.photo;

import java.util.List;

import com.clementheliou.cheliou.dal.model.base.enumeration.SortOrder;
import com.clementheliou.cheliou.dal.model.photo.Photo;
import com.clementheliou.cheliou.dal.model.photo.dto.PhotoDTO;
import com.clementheliou.cheliou.dal.model.photo.enumeration.PhotoSortableColumn;

/**
 * Service used to access the photos of the model's layer.
 * 
 * @author Clément HELIOU (clement.heliou@gmail.com)
 * @since 1.0
 */
public interface PhotoDataAccessService {

	/**
	 * Gets the total number of photos.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @return the resulting number of photos.
	 * @since 1.0
	 */
	Integer countPhotos();

	/**
	 * Gets a photo by its id.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @param id the identifier of the photo we are looking for.
	 * @return the photo if exists, <tt>null</tt> otherwise.
	 * @since 1.0
	 */
	Photo getPhotoById(final Integer id);

	/**
	 * Gets the last photos from the first index with the given page size. The list is ordered on
	 * the given column in the given order.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @param first the first result's index.
	 * @param pageSize the expected number of results.
	 * @param sortColumn the column to be used to sort the results.
	 * @param sortOrder the order to be used to sort the results.
	 * @return the resulting photos list.
	 * @see {@link PhotoDTO}.
	 * @since 1.0
	 */
	List<PhotoDTO> getLastPhotos(int first, int pageSize, PhotoSortableColumn sortColumn, SortOrder sortOrder);
}
